﻿/****** Object:  Table [dbo].[tbAutoCompleteProcessador]    Script Date: 03/23/2011 00:00:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbAutoCompleteProcessador](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Descricao] [varchar](max) NULL,
	[Ativo] [bit] NULL,
 CONSTRAINT [PK_dbAutoCompleteProcessador] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[tbLogin]    Script Date: 03/23/2011 00:00:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbLogin](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[NomeUsuario] [varchar](150) NULL,
	[Senha] [varchar](150) NULL,
	[Ativo] [bit] NULL,
 CONSTRAINT [PK_tbLogin] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[tbTipoEvento]    Script Date: 03/23/2011 00:00:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbTipoEvento](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Descricao] [varchar](max) NULL,
	[Ativo] [bit] NULL,
 CONSTRAINT [PK_dbTipoEvento] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[tbFornecedor]    Script Date: 03/23/2011 00:00:28 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbFornecedor](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Nome] [varchar](200) NULL,
	[Telefone] [varchar](30) NULL,
	[Contato] [varchar](150) NULL,
	[Ativo] [bit] NULL,
 CONSTRAINT [PK_dbFornecedor] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[tbEmpresa]    Script Date: 03/23/2011 00:00:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbEmpresa](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[NomeEmpresa] [varchar](200) NULL,
	[CNPJ] [varchar](15) NULL,
	[NomeResponsavel] [varchar](150) NULL,
	[Email_Responsavel] [varchar](150) NULL,
	[ID_Login] [int] NULL,
	[Ativo] [bit] NULL,
 CONSTRAINT [PK_tbEmpresa] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[tbEvento]    Script Date: 03/23/2011 00:00:26 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbEvento](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[ID_Computador] [int] NULL,
	[Data] [datetime] NULL,
	[Descricao] [varchar](max) NULL,
	[TipoEvento] [int] NULL,
	[Custo] [money] NULL,
	[Ativo] [bit] NULL,
 CONSTRAINT [PK_dbEvento] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[tbComputador]    Script Date: 03/23/2011 00:00:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[tbComputador](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[ID_Empresa] [int] NULL,
	[ID_Fornecedor] [int] NULL,
	[NumeroIdentificador] [varchar](10) NULL,
	[Processador] [varchar](100) NULL,
	[Memoria] [varchar](100) NULL,
	[HD] [varchar](100) NULL,
	[Preco] [money] NULL,
	[DataCompra] [datetime] NULL,
	[DataFimGarantia] [datetime] NULL,
	[Ativo] [bit] NULL,
 CONSTRAINT [PK_dbComputador] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  ForeignKey [FK_dbComputador_dbFornecedor]    Script Date: 03/23/2011 00:00:21 ******/
ALTER TABLE [dbo].[tbComputador]  WITH CHECK ADD  CONSTRAINT [FK_dbComputador_dbFornecedor] FOREIGN KEY([ID_Fornecedor])
REFERENCES [dbo].[tbFornecedor] ([ID])
GO
ALTER TABLE [dbo].[tbComputador] CHECK CONSTRAINT [FK_dbComputador_dbFornecedor]
GO
/****** Object:  ForeignKey [FK_tbEmpresa_tbComputador]    Script Date: 03/23/2011 00:00:24 ******/
ALTER TABLE [dbo].[tbEmpresa]  WITH CHECK ADD  CONSTRAINT [FK_tbEmpresa_tbComputador] FOREIGN KEY([ID])
REFERENCES [dbo].[tbComputador] ([ID])
GO
ALTER TABLE [dbo].[tbEmpresa] CHECK CONSTRAINT [FK_tbEmpresa_tbComputador]
GO
/****** Object:  ForeignKey [FK_tbEmpresa_tbLogin]    Script Date: 03/23/2011 00:00:24 ******/
ALTER TABLE [dbo].[tbEmpresa]  WITH CHECK ADD  CONSTRAINT [FK_tbEmpresa_tbLogin] FOREIGN KEY([ID_Login])
REFERENCES [dbo].[tbLogin] ([ID])
GO
ALTER TABLE [dbo].[tbEmpresa] CHECK CONSTRAINT [FK_tbEmpresa_tbLogin]
GO
/****** Object:  ForeignKey [FK_dbEvento_dbComputador]    Script Date: 03/23/2011 00:00:26 ******/
ALTER TABLE [dbo].[tbEvento]  WITH CHECK ADD  CONSTRAINT [FK_dbEvento_dbComputador] FOREIGN KEY([ID_Computador])
REFERENCES [dbo].[tbComputador] ([ID])
GO
ALTER TABLE [dbo].[tbEvento] CHECK CONSTRAINT [FK_dbEvento_dbComputador]
GO
/****** Object:  ForeignKey [FK_dbEvento_dbTipoEvento]    Script Date: 03/23/2011 00:00:26 ******/
ALTER TABLE [dbo].[tbEvento]  WITH CHECK ADD  CONSTRAINT [FK_dbEvento_dbTipoEvento] FOREIGN KEY([TipoEvento])
REFERENCES [dbo].[tbTipoEvento] ([ID])
GO
ALTER TABLE [dbo].[tbEvento] CHECK CONSTRAINT [FK_dbEvento_dbTipoEvento]
GO
